<template>
  <div id="app">
    <el-container>
      <el-header>Header</el-header>
      <el-container>
        <el-aside width="200px">
          <el-menu :router="true" class="el-menu-app">
            <!--基座中可以放自己的路由-->
            <el-menu-item index="/">Home</el-menu-item>
            <el-menu-item index="/about">About</el-menu-item>
            <!--引用其他子应用-->
            <el-menu-item index="/vue">vue应用</el-menu-item>
            <el-menu-item index="/react">react应用</el-menu-item>
          </el-menu>
        </el-aside>
        <el-main class="el-main-app">
          <router-view></router-view>
          <div id="vue"></div>
          <div id="react"></div>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>
<script>
import { start } from "qiankun";
export default {
  name: "Main",
  mounted() {
    if (!window.qiankunStarted) {
      window.qiankunStarted = true;
      start();
    }
  },
};
</script>
<style>
* {
  margin: 0;
  padding: 0;
}
.el-menu-app {
  color: #333;
  text-align: center;
  line-height: 200px;
  height: calc(100vh - 60px);
  overflow: hidden;
}
.el-main-app {
  height: calc(100vh - 60px);
}
</style>